package com.biscuit.page.basicservice.conf.properties;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.InitializingBean;

import java.util.Arrays;
import java.util.List;

/**
 * @author mazihao
 * @createTime 2024/4/13 15:20
 */
@Getter
public class RequestWhitelistProperties implements InitializingBean {

    /**
     * 请求地址白名单列表
     */
    @Setter
    private List<String> whitelistUrlList;

    /**
     * 静态资源白名单列表
     */
    private final List<String> staticResourceList =
            Arrays.asList(
                    "/static/**",
                    "/public/**",
                    "/resources/**",
                    "/META-INF/resources/**",
                    "/swagger**",
                    "/v3/**",
                    "/webjars/**", // 修改为 "/webjars/**"，不需要再单独列出 "/webjars"
                    "/**.jpg",
                    "/**.json",
                    "/**.ico",
                    "/**.gif",
                    "/**.jpeg",
                    "/**.js",
                    "/**.css",
                    "/**.html",
                    "/**.png",
                    "/**.woff",
                    "/**.woff2",
                    "/**.ttf",
                    "/**.svg"
            );

    @Override
    public void afterPropertiesSet() throws Exception {

    }
}
